 var xmlHttp

    function showHint(str){
        if(str.length == 0){
            document.getElementById("txtHint").innerHTML = "";
            return;
        }
        xmlHttp = getXMLHttpRequest();
        if(xmlHttp == null){
            alert("Your browser does not support AJAX!");
            return;
        }
        var url = "server.php";
        url = url + "?q=" + str;
        xmlHttp.onreadystatechange = stateChanged;
        xmlHttp.open("GET", url, true);
        xmlHttp.send(null);
    }
    
    function getXMLHttpRequest(){
        try{
            xmlHttp = new XMLHttpRequest();
        }
        catch(e){
            try{
                xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
            }
            catch(e){
                xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
            }
        }
        return xmlHttp;
        }

    function stateChanged(){
        if(xmlHttp.readyState == 4){
				response = JSON.stringify(xmlHttp.responseText);
				document.getElementById("txtHint").innerHTML = response;
        }
    }



